package com.itheima.leyou.service;

import com.itheima.leyou.search.dto.SearchParamDTO;
import com.itheima.leyou.search.entity.Goods;
import com.leyou.starter.elastic.entity.PageInfo;
import reactor.core.publisher.Mono;

import java.util.List;
import java.util.Map;

public interface SearchService {
    Mono<List<String>> getSuggestion(String key);

    Mono<PageInfo<Goods>> generateSearch(SearchParamDTO searchParamDTO);

    Mono<Map<String,List<?>>> searchFilter(SearchParamDTO searchParamDTO);

    /**
     * 新增一个商品到索引库
     * @param id 商品id
     */
    void saveGoodsById(Long id);

    /**
     * 从索引库删除一个商品
     * @param id 商品id
     */
    void deleteGoodsById(Long id);
}
